import axios from '@/utils/axios';

//会议室类型列表
export const categoryList = (data) => {
    return axios({
      // headers: {'isMork': true},
        url: '/conference/room/category/list',
      // url:'/conference/conferenceType/categoryList',
      method: 'post',
      data
    })
}
//新增会议室类型
export const addCategory = (data) => {
    return axios({
      url: '/conference/room/category',
      // headers: {'isMork': true},
      // url:'/conference/conferenceType/addCategory',
      method: 'post',
      data
    })
}
//获取会议室类型详情
export const getCategory = (catId) => {
    return axios({
      // headers: {'isMork': true},
      // url:'/conference/conferenceType/getCategory',
      url: `/conference/room/category/${catId}`,
      method: 'get'
    })
}
//修改会议室类型
export const putCategory = (data) => {
    return axios({
      // headers: {'isMork': true},
      // url:'/conference/conferenceType/addCategory',
      url: '/conference/room/category',
      method: 'put',
      data
    })
}
//删除会议室类型
export const delCategory = (catId) => {
    return axios({
      // headers: {'isMork': true},
      // url:'/conference/conferenceType/addCategory',
      url: `/conference/room/category/${catId}`,
      method: 'delete'
    })
}

//全部会议室列表
export const allList = (data) => {
    return axios({
      // headers: {'isMork': true},
      // url:'/conference/conferenceAll/allList',
      url: '/conference/room/list',
      method: 'post',
      data
    })
}
//新增会议室  /room
export const addRoom = (data) => {
    return axios({
      // headers: {'isMork': true},
      // url:'/conference/conferenceType/addCategory',
      url: '/conference/room',
      method: 'post',
      data
    })
}
//修改会议室  /room
export const putRoom = (data) => {
    return axios({
      url: '/conference/room',
      method: 'put',
      data
    })
}
//获取会议室
export const getRoom = (roomId) => {
    return axios({
      // headers: {'isMork': true},
      // url:'/conference/conferenceAll/getRoom',
      url: `/conference/room/${roomId}`,
      method: 'get'
    })
}
//删除会议室
export const delRoom = (roomId) => {
    return axios({
      // headers: {'isMork': true},
      // url:'/conference/conferenceType/addCategory',
      url: `/conference/room/${roomId}`,
      method: 'delete'
    })
}
//查询会议室类型下是否有未审批的会议  
export const getHsaMeeting = (catId) => {
    return axios({
      // headers: {'isMork': true},
      // url:'/conference/conferenceType/getHsaMeeting',
      url: `/conference/room/category/hsaMeeting/${catId}`,
      method: 'get'
    })
}
//查询业务流程配置 /processBusiness/getProcessByBusinessCode
export const getProcessByBusinessCode = () => {
  return axios({
    url: `/workflow/config/processBusiness/findOneByCode?businessCode=Meeting&sysCode=n9dNxP6xCEr3`,
    method: 'get'
  })
}
//获取编码  
export const nextval = (ruleCode,data) => {
  return axios({
    url: `/base/rule/nextval/${ruleCode}`,
    // headers: {'isMork': true},
    // url:'/conference/conferenceType/nextval',
    method: 'post',
    data
  })
}